package com.hspedu.exception_.ClassExercise;

import java.util.Date;

/**
 * @Author Stringzhua
 * @Date 2024/3/7 21:48
 * description:
 */
public class Person {
    public static void main(String[] args) {
        Object obj = new Date();
        Person person;
        person= (Person) obj;//向下转型  ClassCastException类型转换异常
        //Exception in thread "main" java.lang.ClassCastException: java.util.Date cannot be cast to com.hspedu.exception_.ClassExercise.Person
        System.out.println(person);
    }
}
